<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script type="text/javascript">

        //编写JAVAscripet对象  es6
        var user = {
            name:"qinjiang",
            age:3,
            sex:"男"
        };

        //将js对象转换为json对象
        var json = JSON.stringify(user);
        console.log(json);

        //将json对象转化为js对象
       var obj =  JSON.parse(json);
       console.log(obj);

    </script>

</head>
<body>

</body>
</html>